//
//  ContentTableViewCell.m
//  ZhihunewPaper
//
//  Created by 梅杰 on 16/7/10.
//  Copyright © 2016年 梅杰. All rights reserved.
//

#import "ContentTableViewCell.h"

@implementation ContentTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    [self initWeight];
    self.backgroundColor = [UIColor clearColor];
    return self;
}
- (void)initWeight {
    UILabel *label = [[UILabel alloc] init];
    self.contentLabel = label;
    [self.contentView addSubview:label];
    __weak typeof(self) __wakeme = self;
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(__wakeme.contentView).offset(10);
        make.width.equalTo(__wakeme.mas_width).multipliedBy(0.70);
        make.top.equalTo(__wakeme.contentView).offset(10);
        make.bottom.equalTo(__wakeme.contentView).offset(-10);
    }];
//    label.backgroundColor = [UIColor redColor];
    label.numberOfLines = 0;
//    [label sizeToFit];
    label.backgroundColor = [UIColor clearColor];
    label.textAlignment = NSTextAlignmentLeft;
    
    //    labelButton.backgroundColor = [UIColor redColor];
    
    UIImageView *imageView = [[UIImageView alloc] init];
    self.contentImageView = imageView;
    [self.contentView addSubview:imageView];
    __weak typeof(UIImageView *) __wakeImageView = imageView;
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.trailing.equalTo(__wakeme).offset(-10);
        make.width.equalTo(__wakeImageView.mas_height).multipliedBy(1.1);
        make.centerY.equalTo(__wakeme);
        make.height.equalTo(label);
    }];
}

@end
